#include<bits/stdc++.h>
using namespace std;
int main()
{
	double x;
	cin>>x;
	if(x<0) printf("%.2f",abs(x));
	if(0<=x&&x<2) printf("%.2f",sqrt(x+1));
	if(2<=x&&x<4) printf("%.2f",pow(x+2,5));
	if(x>=4) printf("%.2f",2*x+5);
    return 0;
}
